<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ include file="../common.jsp" %>

<script type="text/javascript">
	$(document).ready(function(){
		setPageTitle('<tiles:getAsString name="pageTitle"/>');
		/* createLayoutForAddOrEdit('uploadDocNorthPane','uploadDocTabs'); */
		setWorkFlowURL('<c:out value="${flowExecutionUrl}" />');
		remarksDialog=null;
		vaultDetailsDialog=null;
		rejectDocDialog=null;
		/* createMapUserDialog(); 
		setDialogDiv('mapUsers');
		createSerachUserDialog(); */
		$("#linkedDocId").selectable();
	});
</script>

<div align="center">
	<table class="bodyTable">
		<tr>
			<td>
				<table class="filtersTable zeroBorder" style="width: 100%;">
					<tr class="tableChildHeaderColor" align="left" style="width: 100%;">
						<td>
							<table style="width: 100%;" >
								<tr>
									<td style="width: 80%;">
										<table>
											<tr>
												<td class="spacingColumnWidthLess"></td>
												<td align="left">
													<!-- <img alt="" src="./customTheme/Icons/BlueLotus_DMS_icons-11.png"> -->
												</td>
												<td class="spacingColumnWidthLess"></td>
												<td style="vertical-align: middle;"><span class="tableMainHeaderFont">REVIEW DOCUMENT</span></td>
											</tr>
										</table>
									</td>
									<td style="width: 20%;">
										<table class="zeroBorder" style="width: 100%;">
											<tr align="right">
												<td >
													<input type="button" class="formButton" value="Back" onclick="javascript:workFlowDetail('docAttrDTO','back');"/>
													&nbsp;
													<input type="button" class="formButtonApproval" style="background-color: green; color: white; border-color: green; " value="Review" onclick="javascript:submitDocument('submit','approve');"/>&nbsp;
									 				<input type="button" class="formButtonApproval" style="background-color: red; color: white; border-color: red;" value="Reject" onclick="javascript:submitDocument('submit','reject');"/>&nbsp;
													<!-- <input type="button" class="formButton" value="Submit" onclick="javascript:submitDocument('submit')"/> -->
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr class="formSpacingRow formBlockColor"><td></td></tr>
					<tr>
						<td align="center">
						<div id="uploadDocTabs" class="formBlockColor"  style="overflow: auto;">
							<form:form commandName="docDetailsForm" id="uploadNewDocForm" name="uploadNewDocForm" action="${flowExecutionUrl}" enctype="multipart/form-data" method="POST">
							<form:hidden path="originalDocTypeId" value="-1"/>
							<form:hidden path="docId" value="${docDetailsForm.docId}"/>
								<table style="width: 100%;" border="0" class="formTable" >
									
									<tr  align="left">
										<td class="spacingColumnWidthLess">&nbsp;</td>
										<td colspan="3" align="right">
											<div class="ui-corner-all" style="width: 80%; border-style: dotted; border-width:1px; height: 3em; padding: 10px; text-align: left;">
												<span class="formLabel">Attached Document:&nbsp;</span>
												<br><a target="_blank" href="downloadAttachment/${docDetailsForm.docId}.htm">${docDetailsForm.docName}</a>
												
											</div> 
										</td>
										<td class="spacingColumnWidthMedium"></td>
										<td colspan="3" align="left">
											<c:if test='${!fn:contains(currentDocStatus,"RenewWfip")}'>
											<div class="ui-corner-all" style="width: 80%; border-style: dotted; border-width:1px; height: 3em; padding: 10px; overflow: auto;">
												<span class="formLabel">Link Documents&nbsp;
													<a href="#" onclick="javascript:showDocumentLookUpDialog('uploadNewDocForm');" style="text-decoration: none;">
														<img alt=""  src='<c:url value="/customTheme/Icons/BlueLotus_DMS_icons-30.png"></c:url>'>
													</a>
													
													<input class="formButton ui-corner-all" type="button" value="Delete" onclick="deleteDocument()"/>
													<input class="formButton ui-corner-all" type="button" value="Update" onclick="updateDocumentLink('uploadNewDocForm')"/>
												</span>
												<ul id="linkedDocId" class="userListClass">
												<c:forEach items="${linkedDocumentMap}" var="linkedDocumentMap">
													<li id="${linkedDocumentMap.key}" class="ui-state-default">${linkedDocumentMap.value}</li>
													<input type="hidden" name="linkedDocId" id="${linkedDocumentMap.key}" value="${linkedDocumentMap.key}">
												</c:forEach>
												</ul>
													<c:forEach var="linkedDocumentList" items="${linkedDocumentList}">
									    					<input type="hidden" name="oldLinkedDocument" value="${linkedDocumentList}"></input>
									   				</c:forEach>
									   				
											</div>
											</c:if>
										</td>
										<td class="spacingColumnWidthLess"></td>
									</tr>

									<tr class="formSpacingRow formBlockColor">
										<td colspan="9">
											<hr>
										</td>
									</tr>
									
									<tiles:insertAttribute name="viewAttrDetails"></tiles:insertAttribute>
									<tr class="formSpacingRow formBlockColor">
										<td colspan="9">
											<hr>
										</td>
									</tr>
									
									<tiles:insertAttribute name="viewOwnerDetails"></tiles:insertAttribute>
									
									<tr class="formSpacingRow formBlockColor">
										<td colspan="9">
											<hr>
										</td>
									</tr>
									
									<tiles:insertAttribute name="viewValidityDetails"></tiles:insertAttribute>
									
									<!-- <tr class="formSpacingRow formBlockColor">
										<td colspan="9">
											<hr>
										</td>
									</tr>
									<tr>
										<td colspan="5"></td>
										<td colspan="3" align="right">
											<input type="reset" value="RESET" name="resetForm" class="resetButton">
											<span class="spacingColumnWidthLess">&nbsp;</span>
											<input type="hidden" value="ajaxRequest" name="ajaxSource">
											<input type="button" class="formButton ui-corner-all" value="UPLOAD" onclick="loadContentToServer('uploadNewDocForm','contentDiv')">	
										</td>
										<td class="spacingColumnWidthLess"></td>
									</tr>	 -->												
								</table>
							</form:form>
					</div>
						</td>
				</table>
			</td>
		</tr>
	</table>
</div>

	<div id="remarksDiv" title="Submission Remarks">
	</div>
	